// 工作流接口
import request from '@/utils/request'

// 分页获取流程模型列表
export function modelList(params) {
  return request({
    url: 'activiti/model/list',
    params,
  })
}
// 新增

export function addModel(data) {
  return request({
    url: 'activiti/model',
    data,
    method: 'post',
  })
}
// bushu 

export function bsModel(id) {
  return request({
    url: `/activiti/model/${ id }`,
    method: 'post',
  })
}
// del
export function delModel(id) {
  return request({
    url: `/activiti/model/${ id }`,
    method: 'delete',
  })
}
// 分页查询流程定义列表

export function processList(params) {
  return request({
    url: '/activiti/process/list',
    params,
  })
}

export function getProcess(id, type) {
  return request({
    // eslint-disable-next-line no-useless-concat
    url: `/activiti/process?id=${ id }&type=${ type }`,
    method: 'get',
   
  })
}
export function getProcessimg(id, type) {
  return request({
    // eslint-disable-next-line no-useless-concat
    url: `/activiti/process?id=${ id }&type=${ type }`,
    method: 'get',
    responseType: 'blob',
  })
}

export function putProcess(data) {
  return request({
    url: '/activiti/process',
    data,
    method: 'put',
  })
}
// del
export function delProcess(id) {
  return request({
    url: `/activiti/process/${ id }`,
    method: 'delete',
  })
}